Get Master Locations
/locations
As a Customer of iFoodDS, you can use the Get Master Locations API to query master locations from the iFoodDS Trace Exchange platform. The recommended query parameters support location onboarding, master data management, trading partner setup, FSMA 204 compliance workflows, and supply chain mapping.
This endpoint is being refined and thus subject to change. The query parameters below describe the recommended filter set; availability may depend on implementation phase. These docs will update when changes are made.
Request
Type: application/json
Retrieving master locations via the API is done through paging. Supply optional query parameters in the request URL to select a page and filter the locations returned.
Query Parameters
All query parameters are optional. Applicable search parameters support comma-separated lists as described below.
Pagination & Dates
page(number): The page index of the locations to return. The first page is index 0.size(number): The number of results to return per page. Default value is 20.submitStartDateTime(datetime): Filters results to include only locations submitted after the specified date and time.submitEndDateTime(datetime): Filters results to include only locations submitted before the specified date and time.
Location Identification
id(uuid): Filters by the unique location identifier. Supports comma-separated UUIDs.gln(string): Filters by the Global Location Number. Supports comma-separated values.duns(string): Filters by the Data Universal Numbering System identifier. Supports comma-separated values.locationCode(string): Filters by the location code. Supports comma-separated values.alternateLocationId(string): Filters by the alternate location identifier. Supports comma-separated values.parentLocationId(string): Filters by the parent location identifier to find child locations. Supports comma-separated values.
Location Information
locationName(string): Filters by the location name. Supports comma-separated values.locationType(string): Filters by the location type, such asSupplierorInternal. Supports comma-separated values.businessUnit(string): Filters by the business unit associated with a location. Supports comma-separated values.
Geography
country(string): Filters by the country where a location is situated. Supports comma-separated values.state(string): Filters by the state or province where a location is situated. Supports comma-separated values.city(string): Filters by the city where a location is situated. Supports comma-separated values.postalCode(string): Filters by the postal or ZIP code. Supports comma-separated values.
Regulatory & Hierarchy
isCoveredByGdst(boolean): Filters by whether a location is covered by GDST. Usetrueorfalse.isPrimaryLocation(boolean): Filters by whether a location is a primary location. Usetrueorfalse.glnAssignedBy(string): Filters by the organization that assigned the GLN. Supports comma-separated values.
Multi-Value Support
For the identification, location information, geography, and glnAssignedBy filters, pass multiple values as a comma-separated list in a single query parameter. Separate different query parameters with &.
/locations?locationCode=DC001,DC002
/locations?gln=1234567890123,9876543210987
/locations?locationType=Supplier,Internal
/locations?state=NC,VA
Request Examples
/locations?locationCode=DC001
/locations?state=NC
/locations?gln=1234567890123
/locations?businessUnit=Produce
/locations?isCoveredByGdst=true
To find all distribution centers, use locationType with the value used to classify distribution centers in your location master data.
Implementation Priorities
If implementation is phased, prioritize these 10 filters to cover the majority of onboarding, integration, and traceability requests:
locationCodeglnlocationNamelocationTypecountrystatecitybusinessUnitisCoveredByGdstparentLocationId
Data Constraints
datetimesmust use the format:yyyy-MM-ddTHH:mm:ss.- Pagination, date, and boolean parameters accept a single value.
- URL-encode special characters in query values, such as spaces in location names or business units.
Response
- 200
- 400
Return result for the master locations queried.
{
"content": [
{
"id": "<location id>",
"gln": "<global location number>",
"city": "<city>",
"duns": "<duns number>",
"state": "<state>",
"country": "<country>",
"geoFence": "<geo fence coordinates>",
"postalCode": "<postal code>",
"phoneNumber": "<phone number>",
"businessUnit": "<business unit>",
"locationCode": "<location code>",
"locationName": "<location name>",
"locationType": "<location type>",
"glnAssignedBy": "<gln assigned by>",
"gpsCoordinates": "<gps coordinates>",
"streetAddress1": "<street address 1>",
"streetAddress2": "<street address 2>",
"isCoveredByGdst": <is covered by gdst>,
"parentLocationId": "<parent location id>",
"isPrimaryLocation": <is primary location>,
"alternateLocationId": "<alternate location id>"
}
],
"pageable": {
"pageNumber": <page number>,
"pageSize": <page size>,
"sort": {
"unsorted": <is unsorted>,
"sorted": <is sorted>,
"empty": <is page empty>
},
"offset": <offset size>,
"unpaged": <is unpaged>,
"paged": <is paged>
},
"totalPages": <total pages>,
"totalElements": <total elements>,
"last": <is last page>,
"numberOfElements": <number of elements>,
"size": <page size>,
"number": <page number>,
"sort": {
"unsorted": <is unsorted>,
"sorted": <is sorted>,
"empty": <is empty>
},
"first": <is first page>,
"empty": <is page empty>
}
Content
id(uuid): The unique identifier for the locationgln(string): GS1 Global Location Number, a 13-digit string. GS1 GTIN Executive Summarycity(string): The city where the location is situatedduns(string): Data Universal Numbering System identifierstate(string): The state or province where the location is situatedcountry(string): The country where the location is situatedgeoFence(string): A series of GPS coordinates that define the boundaries of the locationpostalCode(string): The postal or ZIP code for the locationphoneNumber(string): Contact phone number for the locationbusinessUnit(string): The business unit associated with this locationlocationCode(string): A unique code identifier for the locationlocationName(string): The name of the locationlocationType(string): The type of locationglnAssignedBy(string): The organization that assigned the GLNgpsCoordinates(string): The GPS coordinates for the locationstreetAddress1(string): The primary street addressstreetAddress2(string): Additional address information (e.g., suite number)isCoveredByGdst(boolean): Indicate if the location is part of GDSTparentLocationId(string): Identifier for the parent location, if this is a child locationisPrimaryLocation(boolean): Indicates if this is the primary locationalternateLocationId(string): Alternate ID of the location
Pageable
pageable(object)pageNumber(number): The current page number in the page series. Index 0 is first pagepageSize(number): The number of events contained in the pageoffset(number): If there is an offset specified on there return results this will be populates. Default is 0unpaged(boolean): If the record set is unpaged then true else falsepaged(boolean): If the record set is paged then true else falsesort(object)unsorted(boolean): If the record set is unsorted then true else falsesorted(boolean): If the record set is sorted then true else falseempty(boolean): If the record set is empty then true else false
totalPages(number): The total amount of pages that contain all events in the querytotalElements(number): The total amount of events in the querylast(boolean): If the page is the last in the series then true else falsenumberOfElements(number): The total amount of events in the tablesize(number): The number of events contained in the pagenumber(number): The current page number in the page seriessort(object)unsorted(boolean): If the record set is unsorted then true else falsesorted(boolean): If the record set is sorted then true else falseempty(boolean): If the record set is empty then true else false
first(boolean): If the page is the first in the series then true else falseempty(boolean): If the page is empty then true else false
Sample Response
{
"content": [
{
"id": "d96583b3-8cf9-43bb-9db3-02f060bb4a53",
"gln": "1234567890123",
"city": "Springfield",
"duns": "123456789",
"state": "IL",
"country": "US",
"geoFence": "40.28,-84.15,40.29,-84.14,40.27,-84.14",
"postalCode": "62701",
"phoneNumber": "+1-800-555-0199",
"businessUnit": null,
"locationCode": "CDC001",
"locationName": "Central Distribution Center",
"locationType": "Internal",
"glnAssignedBy": "GS1",
"gpsCoordinates": "86.271142,-79.593557",
"streetAddress1": "123 Main St",
"streetAddress2": "Suite 100",
"isCoveredByGdst": false,
"parentLocationId": "HQ001",
"isPrimaryLocation": true,
"alternateLocationId": null
}
],
"pageable": {
"pageNumber": 0,
"pageSize": 20,
"sort": {
"unsorted": true,
"sorted": false,
"empty": true
},
"offset": 0,
"unpaged": false,
"paged": true
},
"totalPages": 22,
"totalElements": 440,
"last": false,
"numberOfElements": 20,
"size": 20,
"number": 0,
"sort": {
"unsorted": true,
"sorted": false,
"empty": true
},
"first": true,
"empty": false
}
Description of what user-fixable validation error occurred and in what part of the payload
{
"timestamp": "2024-12-08T20:47:54.096+00:00",
"status": 400,
"error": "Bad Request",
"message": "<error description>"
}